﻿#pragma once

#include <QtGui/QWidget.h>
#include <QtCore/QTimer.h>

#include "SampleWindow.h"

class QSpectrumView : public QWidget,  ISampleWindowListener
{ 
	Q_OBJECT

public:
	QSpectrumView( QWidget* _parent );

	void					setWaveFormWindow( SampleWindow* waveFormWindow );

protected:
	virtual void			mousePressEvent( QMouseEvent* mouseEvent );
	virtual void			mouseReleaseEvent( QMouseEvent* mouseEvent );
	virtual void			mouseMoveEvent( QMouseEvent* mouseEvent );
	virtual void			wheelEvent(QWheelEvent* wheelEvent);

private:
	virtual	void			paintEvent(QPaintEvent* _paintEvent);
	virtual void			sampleWindowChanged( SampleWindow* sampleWindow );
	void					updateDST();

	static const int		sampleRate = 8000;
		
	SampleWindow*			mWaveFormWindow;
	std::vector<float>		mDST;
	float					mPowerLevel;

	QString					mDebugText;
	QString					mDebugText2;
	QString					mDebugText3;
};
